3.486 \(\int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=94 \[ \frac{i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (1-n)}-\frac{i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-1}}{a d \left (1-n^2\right )} \]

[Out]

(I*(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^n)/(d*(1 - n)) - (I*(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan
[c + d*x])^(1 + n))/(a*d*(1 - n^2))

________________________________________________________________________________________

Rubi [A]  time = 0.116357, antiderivative size = 94, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {3504, 3488} \[ \frac{i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (1-n)}-\frac{i (a+i a \tan (c+d x))^{n+1} (e \sec (c+d x))^{-n-1}}{a d \left (1-n^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^n,x]

[Out]

(I*(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^n)/(d*(1 - n)) - (I*(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan
[c + d*x])^(1 + n))/(a*d*(1 - n^2))

Rule 3504

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(b*f*(m + 2*n)), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] && IL
tQ[Simplify[m + n], 0] && NeQ[m + 2*n, 0]

Rule 3488

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^n)/(a*f*m), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] &
& EqQ[Simplify[m + n], 0]

Rubi steps

\begin{align*} \int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n \, dx &=\frac{i (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n}{d (1-n)}+\frac{\int (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^{1+n} \, dx}{a (1-n)}\\ &=\frac{i (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^n}{d (1-n)}-\frac{i (e \sec (c+d x))^{-1-n} (a+i a \tan (c+d x))^{1+n}}{a d \left (1-n^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.188712, size = 58, normalized size = 0.62 \[ -\frac{i (n-i \tan (c+d x)) (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n-1}}{d (n-1) (n+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(e*Sec[c + d*x])^(-1 - n)*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*(e*Sec[c + d*x])^(-1 - n)*(n - I*Tan[c + d*x])*(a + I*a*Tan[c + d*x])^n)/(d*(-1 + n)*(1 + n))

________________________________________________________________________________________

Maple [C]  time = 0.87, size = 2488, normalized size = 26.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*sec(d*x+c))^(-1-n)*(a+I*a*tan(d*x+c))^n,x)

[Out]

1/2/(I*d+I*n*d)*a^n*e^(-n)/e*exp(I*(d*x+c))^n*exp(-1/2*I*(-2*c+Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1)
)^3*n-2*d*x+Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+Pi*csgn(I*exp(I*(d*x
+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+Pi*csgn(I*exp(2*I*(d*x+c)))^3*n-Pi*
csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n-n*Pi*csgn(I/(exp(2*I*(d*x+c))+1
))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-n*Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(ex
p(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))+Pi*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c
))/(exp(2*I*(d*x+c))+1))^2+Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n+Pi*csgn(I*e)*csgn(I*e/(exp(2
*I*(d*x+c))+1)*exp(I*(d*x+c)))^2-n*Pi*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^3-n*Pi*csgn(I*exp(I*(d*x+c
))/(exp(2*I*(d*x+c))+1))^3-Pi*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^3-Pi*csgn(I*exp(I*(d*x+c))/(exp(2*
I*(d*x+c))+1))^3-Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*
(d*x+c)))-Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-P
i*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n-2*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(
d*x+c)))*n+Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*cs
gn(I*a)*n+Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1
))*n+n*Pi*csgn(I*e)*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+n*Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*e
xp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+n*Pi*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^
2+n*Pi*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+Pi*csgn(I*e
xp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n-Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+
c))+1))^2*n-Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2
*n))+1/2/(-I*d+I*n*d)*a^n*e^(-n)/e*exp(I*(d*x+c))^n*exp(-1/2*I*(2*c+Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c
))+1))^3*n+2*d*x+Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+Pi*csgn(I*exp(I
*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+Pi*csgn(I*exp(2*I*(d*x+c)))^3*
n-Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*n-n*Pi*csgn(I/(exp(2*I*(d*x+
c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-n*Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c)
)/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))+Pi*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(
d*x+c))/(exp(2*I*(d*x+c))+1))^2+Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*n+Pi*csgn(I*e)*csgn(I*e/(
exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2-n*Pi*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^3-n*Pi*csgn(I*exp(I*(
d*x+c))/(exp(2*I*(d*x+c))+1))^3-Pi*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^3-Pi*csgn(I*exp(I*(d*x+c))/(e
xp(2*I*(d*x+c))+1))^3-Pi*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*e
xp(I*(d*x+c)))-Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+
1))-Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*n-2*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*ex
p(I*(d*x+c)))*n+Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)
))*csgn(I*a)*n+Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+
c))+1))*n+n*Pi*csgn(I*e)*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+n*Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csg
n(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+n*Pi*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))
+1))^2+n*Pi*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2+Pi*csg
n(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*n-Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*
(d*x+c))+1))^2*n-Pi*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c
)))^2*n))

________________________________________________________________________________________

Maxima [A]  time = 1.98974, size = 153, normalized size = 1.63 \begin{align*} \frac{{\left (-i \, a^{n} n + i \, a^{n}\right )} \cos \left ({\left (d x + c\right )}{\left (n + 1\right )}\right ) +{\left (-i \, a^{n} n - i \, a^{n}\right )} \cos \left ({\left (d x + c\right )}{\left (n - 1\right )}\right ) +{\left (a^{n} n - a^{n}\right )} \sin \left ({\left (d x + c\right )}{\left (n + 1\right )}\right ) +{\left (a^{n} n + a^{n}\right )} \sin \left ({\left (d x + c\right )}{\left (n - 1\right )}\right )}{2 \,{\left (e^{n + 1} n^{2} - e^{n + 1}\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(-1-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

1/2*((-I*a^n*n + I*a^n)*cos((d*x + c)*(n + 1)) + (-I*a^n*n - I*a^n)*cos((d*x + c)*(n - 1)) + (a^n*n - a^n)*sin
((d*x + c)*(n + 1)) + (a^n*n + a^n)*sin((d*x + c)*(n - 1)))/((e^(n + 1)*n^2 - e^(n + 1))*d)

________________________________________________________________________________________

Fricas [A]  time = 2.41416, size = 271, normalized size = 2.88 \begin{align*} \frac{{\left ({\left (-i \, n + i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, n - i\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} \left (\frac{2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-n - 1}}{d n^{2} +{\left (d n^{2} - d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(-1-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

((-I*n + I)*e^(2*I*d*x + 2*I*c) - I*n - I)*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c) + 1))^n*(2*e*e^(I*d*x
 + I*c)/(e^(2*I*d*x + 2*I*c) + 1))^(-n - 1)/(d*n^2 + (d*n^2 - d)*e^(2*I*d*x + 2*I*c) - d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))**(-1-n)*(a+I*a*tan(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (e \sec \left (d x + c\right )\right )^{-n - 1}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(-1-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((e*sec(d*x + c))^(-n - 1)*(I*a*tan(d*x + c) + a)^n, x)